package test;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;

/**
 * @PROJECT_NAME: 大数据实训
 * @DESCRIPTION:
 * @USER: 韩冰
 * @DATE: 2022/10/8 0008 16:34
 */
public class str {
    public static void main(String[] args) {
        String s = "aabc";
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < s.length(); i++) {
            if (map.get(s.charAt(i)+"") == null) {
                map.put(s.charAt(i) + "", 1);
            } else {
                map.put(s.charAt(i) + "", map.get(s.charAt(i) + "") + 1);
            }
        }
        System.out.println(map);
    }
}
